:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    min-height: 100vh;
    padding: 0;
    position: fixed;
    width: 16.666667%;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.sidebar-header p {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.8;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s;
    font-size: 16px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 10px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* 主内容区样式 */
.main-content {
    margin-left: 16.666667%;
    padding: 0;
    min-height: 100vh;
}

.top-bar {
    background-color: var(--card-background);
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.user-info .separator {
    margin: 0 10px;
    color: #ddd;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 30px 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.section-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.controls {
    display: flex;
    gap: 10px;
}

/* 指标卡片样式 */
.metrics-container {
    padding: 0 30px;
}

.metric-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-right: 15px;
}

.metric-info {
    flex: 1;
}

.metric-info h3 {
    margin: 0 0 5px;
    font-size: 16px;
    color: #666;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color);
}

.metric-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.status-good {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--secondary-color);
}

.status-warning {
    background-color: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

.status-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

/* 图表样式 */
.charts-container {
    padding: 0 30px 30px;
}

.chart-wrapper {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    height: 100%;
}

.chart-wrapper h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text-color);
    text-align: center;
}

canvas {
    width: 100% !important;
    height: 250px !important;
}

/* 设备管理样式 */
.device-list {
    padding: 0 30px;
}

.device-list table {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 数据分析样式 */
.analysis-result {
    padding: 0 30px;
}

.analysis-content {
    min-height: 300px;
    white-space: pre-line;
}

/* 报告列表样式 */
.reports-list {
    padding: 0 30px;
}

.reports-list table {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 设置页面样式 */
.settings-container {
    padding: 0 30px;
}

.settings-container .card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.settings-container .card-header {
    background-color: rgba(52, 152, 219, 0.1);
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}

.settings-container .card-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.modal-header {
    background-color: rgba(52, 152, 219, 0.1);
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}

.report-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.report-content {
    white-space: pre-line;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-bar {
        padding-left: 70px;
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background-color: var(--primary-color);
        color: white;
        border: none;
        border-radius: 5px;
        width: 40px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        margin-top: 15px;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .controls select, .controls button {
        flex: 1;
        min-width: 120px;
    }
    
    .metric-card {
        margin-bottom: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}